<template>
  <div class="background">
    <div class="overlay"></div>
    <div class="container">
      <div class="header">
        <h1 class="title">母校行活动价目表</h1>
        <div class="notice" @mouseover="hoverNotice = true" @mouseleave="hoverNotice = false">
          <h2 :class="{ 'highlight': hoverNotice }">活动须知 <i class="icon-info"></i></h2>
          <p :class="{ 'show': hoverNotice }">请遵守活动规则，注意安全，套餐费用里不包含保险内容。</p>
        </div>
      </div>

      <div class="package-container">
        <div
            v-for="(packageItem, index) in packages"
            :key="index"
            class="package-card"
            :class="{ 'active': activePackage === index }"
            @click="activePackage = index"
            @mouseover="hoverPackage = index"
            @mouseleave="hoverPackage = null"
        >
          <div class="package-header">
            <h3>{{ packageItem.title }}</h3>
            <div class="price">{{ packageItem.price }}</div>
          </div>
          <ul>
            <li v-for="(feature, fIndex) in packageItem.features" :key="fIndex">{{ feature }}</li>
          </ul>
          <div class="package-footer">
            <span v-for="(note, nIndex) in packageItem.notes" :key="nIndex">{{ note }}</span>
          </div>
          <div class="hover-content" v-if="hoverPackage === index">
            <button class="select-btn" @click.stop="selectPackage(index)">选择此套餐</button>
          </div>
        </div>
      </div>

      <div class="additional-info">
        <div class="info-card">
          <h3><i class="icon-star"></i> 增值服务</h3>
          <ul>
            <li v-for="(service, sIndex) in services" :key="sIndex">{{ service }}</li>
          </ul>
        </div>
        <div class="info-card">
          <h3><i class="icon-note"></i> 备注</h3>
          <ul>
            <li v-for="(note, nIndex) in notes" :key="nIndex">{{ note }}</li>
          </ul>
          <div class="promo">
            <p><i class="icon-gift"></i> 首单特惠：预订尊享套餐赠校史盲盒！（限量50份）</p>
            <p><i class="icon-heart"></i> 同窗再聚首，青春不散场</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'BatchList',
  data() {
    return {
      hoverNotice: false,
      hoverPackage: null,
      activePackage: null,
      packages: [
        {
          title: "【基础套餐】青春重温",
          price: "328元/人",
          features: [
            "✅ 校内：校园导览+校史馆+食堂半价餐",
            "✅ 校外：轻徒步（文化路线）",
            "✅ 体验：1小时教室座谈会"
          ],
          notes: [
            "▶ 30人成团 · 赠电子相册",
            "▶ 50人以上享更多优惠"
          ]
        },
        {
          title: "【标准套餐】活力探索",
          price: "588元/人",
          features: [
            "✅ 基础套餐所有内容",
            "✅ 增：校徽帆布包DIY",
            "✅ 校外：半日野营（含烧烤装备）"
          ],
          notes: [
            "▶ 20人成团 · 配专业领队",
            "▶ 30人以上享更多优惠"
          ]
        },
        {
          title: "【尊享套餐】全景沉浸",
          price: "1888元/人",
          features: [
            "✅ 标准套餐所有内容",
            "✅ 增：2天1夜豪华野营（星空+篝火）",
            "✅ 赠：精装纪念册（价值150元）"
          ],
          notes: [
            "▶ 6人起订 · 纪录片跟拍",
            "▶ 12人以上享更多优惠"
          ]
        }
      ],
      services: [
        "• 企业团购：开发票（文化策划类目）",
        "• 包车接送：按广外标准另计费",
        "• 会员特权：优先锁定活动档期"
      ],
      notes: [
        "所有活动需提前15天预约",
        "纪念册可单独订购：150元/册",
        "校外活动含专业保险及急救包"
      ]
    }
  },
  methods: {
    selectPackage(index) {
      this.activePackage = index;
      // 这里可以添加选择套餐后的逻辑，比如跳转到预订页面
    }
  }
}
</script>

<style scoped>
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

.background {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  position: relative;
  padding: 40px 0;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80') no-repeat center center;
  background-size: cover;
  opacity: 0.15;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding: 20px;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(52, 152, 219, 0.2);
}

.title {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 28px;
  color: #2c3e50;
  margin: 0;
}

.notice {
  position: relative;
  cursor: pointer;
}

.notice h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: #2c3e50;
  margin: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.notice h2.highlight {
  color: #3498db;
}

.notice p {
  position: absolute;
  right: 0;
  top: 100%;
  width: 250px;
  background: rgba(52, 152, 219, 0.15);
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
  font-size: 14px;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.notice p.show {
  opacity: 1;
  transform: translateY(5px);
}

.icon-info {
  margin-left: 5px;
  font-size: 14px;
  color: #7f8c8d;
}

.package-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.package-card {
  background: rgba(52, 152, 219, 0.1);
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(52, 152, 219, 0.2);
}

.package-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  background: rgba(52, 152, 219, 0.15);
}

.package-card.active {
  border-color: #3498db;
  background: rgba(52, 152, 219, 0.2);
}

.package-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(52, 152, 219, 0.3);
}

.package-header h3 {
  font-family: 'Noto Serif SC', serif;
  font-weight: 500;
  font-size: 18px;
  color: #2c3e50;
  margin: 0;
}

.price {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 20px;
  color: #e74c3c;
}

.package-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
}

.package-card li {
  padding: 8px 0;
  font-size: 14px;
  color: #34495e;
  border-bottom: 1px dashed rgba(52, 152, 219, 0.3);
}

.package-card li:last-child {
  border-bottom: none;
}

.package-footer {
  margin-top: 15px;
  font-size: 13px;
  color: #7f8c8d;
}

.package-footer span {
  display: block;
  margin-bottom: 5px;
}

.hover-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(52, 152, 219, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.3s ease;
}

.package-card:hover .hover-content {
  opacity: 1;
}

.select-btn {
  background: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  font-family: 'Noto Serif SC', serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.select-btn:hover {
  background: #2980b9;
  transform: scale(1.05);
}

.additional-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
}

.info-card {
  background: rgba(52, 152, 219, 0.1);
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(52, 152, 219, 0.2);
}

.info-card h3 {
  font-family: 'Noto Serif SC', serif;
  font-weight: 500;
  font-size: 18px;
  color: #2c3e50;
  margin-top: 0;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.icon-star, .icon-note, .icon-gift, .icon-heart {
  margin-right: 8px;
  color: #3498db;
}

.info-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 15px 0;
}

.info-card li {
  padding: 8px 0;
  font-size: 14px;
  color: #34495e;
  border-bottom: 1px dashed rgba(52, 152, 219, 0.3);
}

.info-card li:last-child {
  border-bottom: none;
}

.promo {
  margin-top: 20px;
  font-size: 13px;
  color: #7f8c8d;
}

.promo p {
  margin: 5px 0;
  display: flex;
  align-items: center;
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .notice {
    margin-top: 15px;
  }

  .notice p {
    right: auto;
    left: 0;
  }
}
</style>